function y = currentVSw(phi,omega,span,CONSTS)

    Vn = CONSTS.Vn;
    w1 = span(1);
    w2 = span(2);
    dw = w2-w1;
    c = CONSTS.c;
    Z0 = 4*pi/c;
    a = CONSTS.a;
    d = CONSTS.d;
    
    eps_a = CONSTS.eps_a;
    wH    = CONSTS.omega_H;
    wp    = CONSTS.omega_p;
    
    pm_w = -sign(omega);
    
    k0 = omega./c;
    epsVSw = (1 + (wp^2)./(wH^2 - omega.^2));
    etaVSw = (1 - (wp^2)./(omega.^2));
    ksiVSw = (1/2)*(sqrt(abs(epsVSw.*etaVSw))-1i.*pm_w.*eps_a);
    hVSw = k0.*((1+1i.*pm_w)/(sqrt(2))).*ksiVSw.^0.5;
    
    V_VSw = (Vn.*pi./(dw)).*(heaviside(omega+w2)-heaviside(omega-w2)-...
    heaviside(omega+w1)+heaviside(omega-w1));

      
%     y = V_VSw.*((cot(pi.*hVSw.*a)).*(cos(phi.*hVSw.*a))+sin(phi.*hVSw.*a)); %(pi-abs(phi)).*hVSw
    y = 1i.*pm_w.*(V_VSw).*(pi.*hVSw./(Z0.*k0.*log(4*a/d))).*...
        ((cot(pi.*hVSw.*a)).*(cos(abs(phi).*hVSw.*a))+sin(abs(phi).*hVSw.*a)); %((cos((pi-abs(phi)).*hVSw.*a))./(sin(pi.*hVSw.*a)));

end